package com.vvv.myapiclientsdk;

import com.vvv.myapiclientsdk.client.VvvClient;
import com.vvv.myapiclientsdk.config.MyApiProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @author vvv
 * @date 2023-09-25 09 19
 * discription
 */
@EnableConfigurationProperties(MyApiProperties.class)
public class MyApiAutoConfiguration {

    private MyApiProperties myApiProperties;

    public MyApiAutoConfiguration(MyApiProperties myApiProperties) {
        this.myApiProperties = myApiProperties;
    }

    @Bean
    public VvvClient vvvClient() {
        return new VvvClient(myApiProperties.getAccessKey()
                , myApiProperties.getSecreteKey());
    }

}
